import {createZDragComponentV2, createZDragTemplate} from "../factory";

export default createZDragComponentV2('ZDragRichEditor',{
  components: {},
  template: createZDragTemplate(`
  <div>
<!--  <div>测试</div>-->
  <iframe-import style="width: 100%; min-height: 350px;" 
  :src="getSrc()" frameborder="none" allowfullscreen></iframe-import>
</div>
  `, {
    className: 'z-dragxml-com-auto'
  }),
  methods: {
    getSrc() {
      // if (this.zdrag__cus_config?.ui?.widgetConfig?.src) {
      //   return this.zdrag__cus_config?.ui?.widgetConfig?.src
      // }
      // return ''
      return  new URL('editor.html', location.origin).href
    }
  },
  data() {
    return {
      ui: {
        label: '编辑器',
        widgetConfig: {
        }
      }
    }
  }
}, {
  DRAG_FIELD: true,
  DRAG_CONFIG() {
    return {
      props: {
        // src: {
        //   type: 'string',
        //   ui: {
        //     label: '地址',
        //   }
        // }
      }
    }
  },
  DRAG_LABEL_XML() {
    return {
      icon: `<svg t="1646028407261" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2276" width="16" height="16"><path d="M313.36 448.094H632.63v31.927H313.36v-31.927zM313.36 583.784h223.49v31.927H313.36v-31.927zM313.36 719.474h127.709v31.927h-127.71v-31.927zM889.412 554.809l-39.955-39.971-39.957-39.941c-7.358-7.358-19.285-7.358-26.642 0l-329.7 329.694a14.08 14.08 0 0 0-4.592 6.873L412.078 932.86a14.158 14.158 0 0 0 3.54 14.079l0.99 0.763 0.77 0.982a14.174 14.174 0 0 0 14.062 3.555l121.395-36.495a14.04 14.04 0 0 0 6.938-4.677l329.639-329.63c7.35-7.343 7.35-19.284 0-26.627zM541.136 889.756l-95.198 28.622 28.623-95.235 255.02-255.02 66.6 66.599-255.045 255.034zM856.112 574.78l-46.611 46.611-66.59-66.598 46.605-46.597c3.677-3.68 9.641-3.68 13.319-0.016l26.892 26.892 26.384 26.394c3.68 3.68 3.68 9.65 0.001 13.314z" p-id="2277"></path><path d="M671.874 224.898v-28.934c0-22.004-17.905-39.909-39.909-39.909H314.026c-22.004 0-39.909 17.905-39.909 39.91v28.933h-104.43v643.564c0 35.26 28.592 63.854 63.855 63.854h127.709v-47.89H249.506c-17.632 0-31.928-14.299-31.928-31.928v-579.71h56.54v10.976c0 22.004 17.904 39.909 39.908 39.909h317.938c22.004 0 39.91-17.905 39.91-39.91V272.79h56.538V437.45h47.89V224.898H671.875z m-47.89 50.884H322.007v-71.836h301.974v71.836z" p-id="2278"></path></svg>
`,
      name: '富文本编辑'
    }
  },
  DRAG_EXPORT() {
    return {
      ui: {
        widget: 'CusRichEditor'
      }
    }
  },
})
